{{csrf_field()}}
<div class="layui-form-item">
    <label for="" class="layui-form-label">名称</label>
    <div class="layui-input-inline">
        <input class="layui-input" type="text" name="name" lay-verify="required" value="{{$model->name??old('name')}}" placeholder="如：任务一">
    </div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">网关</label>
    <div class="layui-input-inline">
        <select name="gateway_id" lay-verify="required">
            <option value="">请选择</option>
            @foreach($gateways as $gw)
                <option value="{{$gw->id}}" @if(isset($model->gateway_id)&&$model->gateway_id==$gw->id) selected @endif >{{$gw->name}}</option>
            @endforeach
        </select>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label for="" class="layui-form-label">执行日期</label>
        <div class="layui-input-inline" style="width: 190px;">
            <input class="layui-input" type="text" name="date_start" id="date_start" lay-verify="required" value="{{$model->date_start??old('date_start')}}" readonly placeholder="开始日期">
        </div>
        <div class="layui-form-mid"> - </div>
        <div class="layui-input-inline" style="width: 190px;">
            <input class="layui-input" type="text" name="date_end" id="date_end" lay-verify="required" value="{{$model->date_end??old('date_end')}}" readonly placeholder="结束日期">
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label for="" class="layui-form-label">执行时间</label>
        <div class="layui-input-inline" style="width: 190px;">
            <input class="layui-input" type="text" name="time_start" id="time_start" lay-verify="required" value="{{$model->time_start??old('time_start')}}" readonly placeholder="开始时间">
        </div>
        <div class="layui-form-mid"> - </div>
        <div class="layui-input-inline" style="width: 190px;">
            <input class="layui-input" type="text" name="time_end" id="time_end" lay-verify="required" value="{{$model->time_end??old('time_end')}}" readonly placeholder="结束时间">
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">并发倍数</label>
    <div class="layui-input-inline">
        <input class="layui-input" type="number" name="channel" lay-verify="required|number" value="{{$model->channel??2}}" placeholder="">
    </div>
    <div class="layui-word-aux layui-form-mid">并发数，建议为2以上</div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">等待时长</label>
    <div class="layui-input-inline">
        <input class="layui-input" type="number" name="max_wait_time" lay-verify="required|number" value="{{$model->max_wait_time??30}}" placeholder="">
    </div>
    <div class="layui-word-aux layui-form-mid">呼通客户后的最大等待时间</div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">接听坐席</label>
    <div class="layui-input-block">
        @include('common.get_sips_by_task_id',['task_id'=>$model->id??0])
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" class="layui-btn layui-btn-sm" lay-submit lay-filter="go-close-refresh" >确认</button>
    </div>
</div>
